package com.mlnx.transport.controller;

import com.mlnx.transport.service.DataTransportService;

import org.shan.spring.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * Created by amanda.shan on 2020/3/20.
 */
@Api(value = "数据同步", tags = {"数据同步"})
@RestController
@RequestMapping("/transport")
public class TransportController extends BaseController {

    @Autowired
    private DataTransportService dataTransportService;

    @ApiOperation(value = "开始同步心电数据", notes = "")
    @GetMapping("/start-ecg")
    public void startSynEcg(Integer patientId, Long startTime, Integer limit) {
        dataTransportService.startSynEcg(patientId, startTime, limit);
    }

    @ApiOperation(value = "开始同步心电数据", notes = "")
    @GetMapping("/start-mutil-ecg")
    public void startMutilSynEcg(Integer startPatientId, Integer endPatientId, Long startTime, Integer limit) {
        dataTransportService.startMutilSynEcg(startPatientId, endPatientId, startTime, limit);
    }

    @ApiOperation(value = "结束同步心电数据", notes = "")
    @GetMapping("/stop-ecg")
    public void stopSynEcg() {
        dataTransportService.stopSynEcg();
    }
}
